<?php
include_once '../data/database_dal.php';

class ContactDAL extends DatabaseDAL
{
    function update($id, $mailFrom, $mailTo, $name, $message, $inTime, $inUser)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_contact_update('". $id ."', '". $mailFrom ."', '". $mailTo ."', '". $name ."'m '". $message ."', '". $inTime ."', '". $inUser ."')");
        $this->close();
        return $result;
    }

    function get($where)
    {
        $this->connect();
        return $this->mysqli->query("call pr_contect_get(".'"'.$where.'"'.")");
        $this->close();
        return $result;
    }

    function getAll($orderBy)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_contact_list(".'"'. $orderBy .'"'.")");
        $this->close();
        return $result;
    }

    function delete($id)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_contact_delete('". $id ."')");
        $this->close();
        return $result;
    }
}
?>